package com.erbao.io.netty.refactor.transport;

import com.erbao.io.netty.refactor.rpc.ResponseMappingCallBack;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

public class ClientResponseHandler extends ChannelInboundHandlerAdapter {
    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
        // 响应回来的，要读的。
        if (msg instanceof MyPkgMsg) {
            MyPkgMsg responseMsg = (MyPkgMsg) msg;
            ResponseMappingCallBack.runCallback(responseMsg);
        }

        super.channelRead(ctx, msg);
    }
}
